<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>client</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: pink;
            border: 10px solid red;
            padding: 10px;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        // client 宽度  和我们 offsetWidth 最大的区别就是 不包含边框 但包含 padding 
        var div = document.querySelector('div');
        console.log(div.clientWidth);
        // 返回元素上边框的大小
        console.log(div.clientTop);
        // 返回元素左边框的大小
        console.log(div.clientLeft);
    </script>
</body>
</html>